package com.hqyj.controller;

import com.hqyj.pojo.Classes;
import com.hqyj.pojo.Department;
import com.hqyj.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;

/**
 * <p></p>
 *
 * @author : zlf
 * @date : 2020-09-01 15:25
 **/
@Controller
@RequestMapping("department")
public class DepartmentController {
    @Autowired
    DepartmentService departmentService;
    @RequestMapping("departmentPage")
    public String depart(){
        return "/department/departmentList";
    }
    @RequestMapping("departmentList")
    @ResponseBody
    public HashMap<String,Object> departList(){
        return departmentService.selectDepart();
    }

    @RequestMapping("departmentAllList")
    @ResponseBody
    public HashMap<String,Object> departmentAllList(Department department){
        return departmentService.selectAll(department);
    }
    @RequestMapping("departmentAdd")
    @ResponseBody
    public HashMap<String,Object> departmentAdd(Department department){
        return departmentService.Insert(department);
    }

    @RequestMapping("departmentUpdate")
    @ResponseBody
    public HashMap<String,Object> departmentUpdate(Department department){
        return departmentService.update(department);
    }
}
